package generics;

//: generics/GenericsAndReturnTypes.java

interface GenericGetter<T extends GenericGetter<T>> {
  T get();
}

interface Getter extends GenericGetter<Getter> {}

class Getter1 implements Getter{

	public Getter get() {
		return null;
	}
}

public class GenericsAndReturnTypes {
  void test(Getter g) {
    Getter result = g.get();
    GenericGetter gg = g.get(); // Also the base type
  }
  public static void main(String[] args) {
	new GenericsAndReturnTypes().test(new Getter1());
}
} ///:~
